package com.jie.common.constant;

import com.jie.common.util.SpringUtil;

/**
 * @author jie
 * @version 1.0 2025-02-14 缓存的键值
 */
public class RedisKey {

    /**
     * 注册发送验证码的缓存
     */
    public static final String USER_REGISTER_PHONE_SEND_CODE = "user_register_phone_send_code:";

    /**
     * 用户登录输入错误的次数缓存
     */
    public static final String USER_LOGIN_ERROR_COUNT = "user_login_error_count:";

    /**
     * 登录用户的缓存信息
     */
    public static final String LOGIN_USER_INFO = "login_user_info:";

    /**
     * 城市信息缓存
     */
    public static final String CITY = "city";

    /**
     * 热门城市
     */
    public static final String HOT_CITY = "hot_ity";

    /**
     * 所有的规则
     */
    public static final String ALL_RULE_HASH = "all_rule_hash";

    /**
     * 基础规则
     */
    public static final String RULE = "rule";

    /**
     * 深度规则
     */
    public static final String DEPTH_RULE = "depth_rule";

    /**
     * 调用限制时间
     */
    public static final String RULE_LIMIT = "rule_limit:";

    /**
     * 规则zset
     */
    public static final String Z_SET_RULE_STAT = "z_set_rule_stat:";

    /**
     * 深度调用限制时间
     */
    public static final String DEPTH_RULE_LIMIT = "depth_rule_limit:";

    public static String getRedisKey(String key) {
        return SpringUtil.getPrefixDistinctionName() + "-" + key;
    }
}
